import http from '@/utils/http'

const BASE_URL = '/jobfair/jobPositionResume'

export interface JobPositionResumeResp {
  id: string
  resumeId: string
  positionId: string
  status: string
  studentName: string
  positionName: string
  resumeName: string
  url: string
  createUserString: string
  updateUserString: string
}
export interface JobPositionResumeDetailResp {
  id: string
  resumeId: string
  positionId: string
  createTime: string
  updateTime: string
  createUser: string
  updateUser: string
  status: string
  createUserString: string
  updateUserString: string
}
export interface JobPositionResumeQuery {
  resumeId: string
  positionId: string
  sort: Array<string>
}
export interface JobPositionResumePageQuery extends JobPositionResumeQuery, PageQuery {}

/** @desc 查询岗位简历（投递）列表 */
export function listJobPositionResume(query: JobPositionResumePageQuery) {
  return http.get<PageRes<JobPositionResumeResp[]>>(`${BASE_URL}`, query)
}

/** @desc 查询岗位简历（投递）详情 */
export function getJobPositionResume(id: string) {
  return http.get<JobPositionResumeDetailResp>(`${BASE_URL}/${id}`)
}

/** @desc 新增岗位简历（投递） */
export function addJobPositionResume(data: any) {
  return http.post(`${BASE_URL}`, data)
}

/** @desc 修改岗位简历（投递） */
export function updateJobPositionResume(data: any, id: string) {
  return http.put(`${BASE_URL}/${id}`, data)
}

/** @desc 删除岗位简历（投递） */
export function deleteJobPositionResume(id: string) {
  return http.del(`${BASE_URL}/${id}`)
}

/** @desc 导出岗位简历（投递） */
export function exportJobPositionResume(query: JobPositionResumeQuery) {
  return http.download<any>(`${BASE_URL}/export`, query)
}
